home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Programming
/
LEDA
/
incl
/
LEDA.020+881
/
edge_set.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-05
|
1KB
|
48 lines
/*******************************************************************************
+
+ LEDA 3.1c
+
+
+ edge_set.h
+
+
+ Copyright (c) 1994 by Max-Planck-Institut fuer Informatik
+ Im Stadtwald, 6600 Saarbruecken, FRG
+ All rights reserved.
+
*******************************************************************************/
#ifndef LEDA_EDGE_SET_H
#define LEDA_EDGE_SET_H
#include <LEDA/graph.h>
//------------------------------------------------------------------------------
// edge_set
//------------------------------------------------------------------------------
class edge_set {
graph* g;
list(edge) L;
graph_array(edge) A;
public:
void insert(edge x) { if (A.inf(x) == nil) A.entry(x) = Convert(L.append(x)); }
void del(edge x) { if (A.inf(x) != nil)
{ L.del(list_item(A.inf(x))); A.entry(x) = nil;}
}
bool member(edge x) { return (A.inf(x) != nil) ? true:false; }
edge choose() const { return L.head(); }
int size() const { return L.length(); }
bool empty() const { return L.empty(); }
void clear() { L.clear(); A.init(*g,nil); }
edge_set(const graph& G) { g = (graph*)&G; A.init(G,nil);}
virtual ~edge_set() { L.clear(); A.clear(); }
};
#endif